package cn.iocoder.yudao.module.promotion.gift.pojo.dto;

import cn.iocoder.yudao.framework.business.basic.pojo.dto.SaveDTO;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid;
import jakarta.validation.constraints.FutureOrPresent;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotEmpty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <pre>
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 *  这里是文件说明
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * </pre>
 *
 * @author 山野羡民（1032694760@qq.com）
 * @since 2025/01/13
 */
@Data
@Valid
public class AdminGiftActivitySaveDTO extends SaveDTO {

    @Schema(description = "产品 SKU 信息", example = "小米 Pro 16")
    private String name;

    @Schema(description = "产品 SKU 封面", example = "https://example.local/xx.png")
    private String picUrl;

    @Schema(description = "原价，单位为分，0表示免费")
    private Integer originPrice;

    @Schema(description = "成本价格，单位为分，-1表示不显示价格，0表示免费，用于分账给赠品所属的商家")
    private Integer costPrice;

    @Schema(description = "库存", example = "99")
    private Integer stock;

    @Schema(description = "单位，如：次、条、瓶、份", example = "次")
    @Length(max = 10, message = "单位不能超过 10 个字符")
    private String unit;

    @Schema(description = "限领数量", defaultValue = "-1", example = "-1")
    @Min(value = -1, message = "限领数量必须大于 -1")
    private Integer takeLimitCount;

    @Schema(description = "生效时间", requiredMode = Schema.RequiredMode.REQUIRED)
    private LocalDateTime startTime;

    @Schema(description = "作废时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @FutureOrPresent
    private LocalDateTime endTime;

    @Schema(description = "使用说明", requiredMode = Schema.RequiredMode.REQUIRED, example = "这是赠品的使用说明")
    private String note;

    @Schema(description = "合作方店铺编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1,2,3")
    @NotEmpty(message = "合作方店铺编号不能为空")
    private List<Long> partnerShopIds;

    @Schema(description = "产品 SPU 编号，赠品形式为线上产品时有效", example = "1")
    private Long spuId;

    @Schema(description = "产品 SKU 编号，赠品形式为线上产品时有效", example = "1")
    private Long skuId;

    @Schema(description = "关联的优惠券模板编号，赠品形式为线上优惠券时有效", example = "1")
    private Long couponTemplateId;

}
